package com.example.student.mapper;
import com.example.student.pojo.Score;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 34082
 */
@Mapper
public interface ScoreExcelMapper {

    /**
     * 查询所有学生成绩
     * @return List<Score>
     */
    @Select("Select * from student_scores")
    List<Score> findAllStudents();

    /**
     *  根据班级id查询学生成绩
     * @param classId;
     * @return List<Score>
     */
    @Select("select student_scores.* " +
            "from student_scores " +
            "join students on student_scores.student_number = students.student_id " +
            "where students.dept_id = #{classId} "
            )
    List<Score> getScoresByClassId(Integer classId);

}
